package xin.workflow.rest;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import java.io.Serializable;

/**
 * <pre>
 * Base Response
 * </pre>
 *
 * @author lixin_ma@outlook.com
 * @version 1.0
 * @since 2018/12/19
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@ToString
public class BaseResponse implements Serializable {
    private String code = "200";
    private String msg;

    public static BaseResponse ok(String msg) {
        return new BaseResponse("200",msg);
    }

    public static BaseResponse ok() {
        return new BaseResponse("200",null);
    }

    public static BaseResponse error(String code, String msg) {
        return new BaseResponse(code,msg);
    }
}
